package tw.com.hitevision.whiteboard.android.stateFile;

import android.graphics.Matrix;
import android.graphics.RectF;
import android.net.Uri;

import tw.com.hitevision.whiteboard.android.render.Image;

public class ImageStateFile extends BaseStateFile {
    private float[] transformValues;
    private RectF bounds;
    private float bitmapWidth;
    private float bitmapHeight;
    private String imageFileName;
    private String contentUriStr;
    private String contentURL;

    public ImageStateFile(Image image, float bitmapWidth, float bitmapHeight,
                          Matrix transform, RectF bounds,
                          String imageFileName, Uri contentUri, String contentURL) {
        super(image);
        this.setClassName(Image.class.getSimpleName());

        this.bitmapWidth = bitmapWidth;
        this.bitmapHeight = bitmapHeight;
        transformValues = new float[9];
        transform.getValues(this.transformValues);
        this.bounds = new RectF(bounds);
        this.imageFileName = imageFileName;
        if (contentUri != null) {
            this.contentUriStr = contentUri.toString();
        }
        this.contentURL = contentURL;
    }

    public void setBounds(RectF bounds) {
        this.bounds = bounds;
    }

    public RectF getBounds() {
        return bounds;
    }

    public void setBitmapWidth(float bitmapWidth) {
        this.bitmapWidth = bitmapWidth;
    }

    public float getBitmapWidth() {
        return bitmapWidth;
    }

    public void setBitmapHeight(float bitmapHeight) {
        this.bitmapHeight = bitmapHeight;
    }

    public float getBitmapHeight() {
        return bitmapHeight;
    }

    public void setContentURL(String contentURL) {
        this.contentURL = contentURL;
    }

    public String getContentURL() {
        return contentURL;
    }

    public void setImageFileName(String imageFileName) {
        this.imageFileName = imageFileName;
    }

    public String getImageFileName() {
        return imageFileName;
    }

    public void setContentUriStr(String contentUriStr) {
        this.contentUriStr = contentUriStr;
    }

    public String getContentUriStr() {
        return contentUriStr;
    }

    public void setTransformValues(float[] transformValues) {
        this.transformValues = transformValues;
    }

    public float[] getTransformValues() {
        return transformValues;
    }
}
